package com.itsitio.registeradmin.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "usuarios_registracion") //usuarios_registracion
//public class UserRegistration extends MappedEntity {
public class UserRegistration {

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name = "idx")
	private Integer id;

	//Fecha	
	@Column(name = "fecha")
	private Date registrationDate;

	//Empresa Fantasia = Nombre Comercial = Nombre en el mercado para consumidores
	//nombre comercial
	@Column(name = "empresa_fantasia", length = 200)
	private String companyTradeName;	
	
	//Empresa Nombre = Razon Social (SA, SRL)
	@Column(name = "empresa_nombre", length = 200)
	private String companyFirmName;	

	//taxId = cuit de Empresa
	@Column(name = "empresa_cuit", length = 50)
	private String companyTaxId;

	//tipo de empresa
	@ManyToOne(cascade = CascadeType.MERGE)
	@JoinColumn(name="empresa_tipo")
	CompanyType companyType;
	
	//web == empresa_web
	@Column(name = "empresa_web", length = 200)
	private String companyWebsite;

	//pais de la empresa = empresa_idxpais
	@ManyToOne(cascade = CascadeType.MERGE)
	@JoinColumn(name="empresa_idxpais")
	private Country companyCountry; 
	
	//Nombre de Sucursal 
	@Column(name = "sucursal_nombre", length = 200)//, nullable = false)
	private String branchName;

	//Central de Sucursal 
	@Column(name = "sucursal_central")//, nullable = false)
	private Byte branchCentral;

	//Direccion de Sucursal 
	@Column(name = "sucursal_direccion", length = 200)//, nullable = false)
	private String branchAddress;

	//Localidad de Sucursal 
	@Column(name = "sucursal_localidad", length = 200)//, nullable = false)
	private String branchCity;
	
	//Codigo Postal de Sucursal 
	@Column(name = "sucursal_cp", length = 50)//, nullable = false)
	private String branchZipPostal;

	// Provincia de la Sucursal -- sucursal_idxprovincia
	@ManyToOne(cascade = CascadeType.MERGE)
	@JoinColumn(name="sucursal_idxprovincia")
	private Province branchProvince;	

	//Telefono de Sucursal 
	@Column(name = "sucursal_telefono", length = 100)//, nullable = false)
	private String branchPhone;
	
	//Fax de Sucursal 
	@Column(name = "sucursal_fax", length = 100)//, nullable = false)
	private String branchFax;

	//Correo Electronico de Sucursal 
	@Column(name = "sucursal_email", length = 200)//, nullable = false)
	private String branchEmail;

	//taxId = cuit de Sucursal
	@Column(name = "sucursal_cuit", length = 50)
	private String branchTaxId;
		
	//Apelido del Usuario
	@Column(name = "usuario_apellido", length = 200)//, nullable = false)
	private String userLastName;

	//Nombre del Usuario
	@Column(name = "usuario_nombre", length = 200)//, nullable = false)
	private String userFirstName;
	
	//
	//TODO agregar aqui el pais del usuario
	//

	//Sexo del Usuario 
	@Column(name = "usuario_sexo")//, nullable = false)
	private Byte userSex;

	//Correo Electronico del Usuario
	@Column(name = "usuario_email", length = 200)//, nullable = false)
	private String userEmail;
	
	//Area del usuario en la Empresa, se usa usuario_area x que se envio mail con select
	@ManyToOne(cascade = CascadeType.MERGE)
	@JoinColumn(name="usuario_area")
	CompanyDepartment companyDepartment;

	//Cargo del usuario en la Empresa, se usa usuario_cargo x que se envio mail con select
	@ManyToOne(cascade = CascadeType.MERGE)
	@JoinColumn(name="usuario_cargo")
	CompanyPosition companyPosition;
	
	//Usuario descripcion del Cargo
	@Column(name = "usuario_descripcion_cargo", length = 200)//, nullable = false)
	private String userPositionDescription;

	//
	//TODO agregar aqui el Tipo de Usuario
	//
	
	//Direccion Domicilio del Usuario 
	@Column(name = "usuario_domicilio", length = 255)//, nullable = false)
	private String userAddress;
	
	//Usuario Localidad / Ciudad 
	@Column(name = "usuario_localidad", length = 255)//, nullable = false)
	private String userCity;
	
	//
	//TODO agregar aqui el pais del usuario
	//
	
	//Codigo Postal del Usuario 
	@Column(name = "usuario_cod_postal", length = 255)//, nullable = false)
	private String userZipPostal;
	
	//Telefono del Usuario 
	@Column(name = "usuario_telefono", length = 50)//, nullable = false)
	private String userPhone;

	//DNI del Usuario 
	@Column(name = "usuario_documento", length = 20)//, nullable = false)
	private String userNationIdCard;
	
	//Estado de la Registracion del Usuario
	@Column(name="estado", columnDefinition="enum('nueva','analisis','pendiente','rechazada','pre-aceptada','aceptada','modificacion','baja','nueva Radios','borrador','Emblue')")
	private String status; 
	
	// Portal donde se Registro el usuario
	//@org.hibernate.annotations.NotFound(action=org.hibernate.annotations.NotFoundAction.IGNORE)
	@ManyToOne(cascade = CascadeType.MERGE)
	@JoinColumn(name="carac_idxportal")
	private Portal portal;	
	
	//observaciones
	@Column(name = "observaciones", length = 65535, columnDefinition="Text")
	private String comments;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Date getRegistrationDate() {
		return registrationDate;
	}

	public void setRegistrationDate(Date registrationDate) {
		this.registrationDate = registrationDate;
	}

	public String getCompanyTradeName() {
		return companyTradeName;
	}

	public void setCompanyTradeName(String companyTradeName) {
		this.companyTradeName = companyTradeName;
	}

	public String getCompanyFirmName() {
		return companyFirmName;
	}

	public void setCompanyFirmName(String companyFirmName) {
		this.companyFirmName = companyFirmName;
	}

	public String getCompanyTaxId() {
		return companyTaxId;
	}

	public void setCompanyTaxId(String companyTaxId) {
		this.companyTaxId = companyTaxId;
	}

	public String getCompanyWebsite() {
		return companyWebsite;
	}

	public void setCompanyWebsite(String companyWebsite) {
		this.companyWebsite = companyWebsite;
	}

	public String getBranchName() {
		return branchName;
	}

	public void setBranchName(String branchName) {
		this.branchName = branchName;
	}

	public Byte getBranchCentral() {
		return branchCentral;
	}

	public void setBranchCentral(Byte branchCentral) {
		this.branchCentral = branchCentral;
	}

	public String getBranchAddress() {
		return branchAddress;
	}

	public void setBranchAddress(String branchAddress) {
		this.branchAddress = branchAddress;
	}

	public String getBranchCity() {
		return branchCity;
	}

	public void setBranchCity(String branchCity) {
		this.branchCity = branchCity;
	}

	public String getBranchZipPostal() {
		return branchZipPostal;
	}

	public void setBranchZipPostal(String branchZipPostal) {
		this.branchZipPostal = branchZipPostal;
	}

	public String getBranchPhone() {
		return branchPhone;
	}

	public void setBranchPhone(String branchPhone) {
		this.branchPhone = branchPhone;
	}

	public String getBranchFax() {
		return branchFax;
	}

	public void setBranchFax(String branchFax) {
		this.branchFax = branchFax;
	}

	public String getBranchEmail() {
		return branchEmail;
	}

	public void setBranchEmail(String branchEmail) {
		this.branchEmail = branchEmail;
	}

	public String getBranchTaxId() {
		return branchTaxId;
	}

	public void setBranchTaxId(String branchTaxId) {
		this.branchTaxId = branchTaxId;
	}

	public String getUserLastName() {
		return userLastName;
	}

	public void setUserLastName(String userLastName) {
		this.userLastName = userLastName;
	}

	public String getUserFirstName() {
		return userFirstName;
	}

	public void setUserFirstName(String userFirstName) {
		this.userFirstName = userFirstName;
	}

	public Byte getUserSex() {
		return userSex;
	}

	public void setUserSex(Byte userSex) {
		this.userSex = userSex;
	}

	public String getUserEmail() {
		return userEmail;
	}

	public void setUserEmail(String userEmail) {
		this.userEmail = userEmail;
	}
		
	public CompanyDepartment getCompanyDepartment() {
		return companyDepartment;
	}

	public void setCompanyDepartment(CompanyDepartment companyDepartment) {
		this.companyDepartment = companyDepartment;
	}

	public CompanyPosition getCompanyPosition() {
		return companyPosition;
	}

	public void setCompanyPosition(CompanyPosition companyPosition) {
		this.companyPosition = companyPosition;
	}

	public String getUserPositionDescription() {
		return userPositionDescription;
	}

	public void setUserPositionDescription(String userPositionDescription) {
		this.userPositionDescription = userPositionDescription;
	}

	public String getUserAddress() {
		return userAddress;
	}

	public void setUserAddress(String userAddress) {
		this.userAddress = userAddress;
	}

	public String getUserCity() {
		return userCity;
	}

	public void setUserCity(String userCity) {
		this.userCity = userCity;
	}

	public String getUserZipPostal() {
		return userZipPostal;
	}

	public void setUserZipPostal(String userZipPostal) {
		this.userZipPostal = userZipPostal;
	}

	public String getUserPhone() {
		return userPhone;
	}

	public void setUserPhone(String userPhone) {
		this.userPhone = userPhone;
	}

	public String getUserNationIdCard() {
		return userNationIdCard;
	}

	public void setUserNationIdCard(String userNationIdCard) {
		this.userNationIdCard = userNationIdCard;
	}

	public Province getBranchProvince() {
		return branchProvince;
	}

	public void setBranchProvince(Province branchProvince) {
		this.branchProvince = branchProvince;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Portal getPortal() {
		return portal;
	}

	public void setPortal(Portal portal) {
		this.portal = portal;
	}

	public CompanyType getCompanyType() {
		return companyType;
	}

	public void setCompanyType(CompanyType companyType) {
		this.companyType = companyType;
	}

	public Country getCompanyCountry() {
		return companyCountry;
	}

	public void setCompanyCountry(Country companyCountry) {
		this.companyCountry = companyCountry;
	}

	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	
	
}
